package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.WxUserDao;
import cn.topevery.garden.entity.po.WxUser;
import cn.topevery.garden.entity.query.WxUserQuery;
import cn.topevery.garden.entity.vo.WxUserVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-10
 */
@Service
public class WxUserLogic extends BaseLogic<WxUser> {
    @Autowired
    WxUserDao wxUserDao;

    @Override
    public BaseEntityDao<WxUser, Integer> getDao() {
        return wxUserDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<WxUserVO> listPage(WxUserQuery query) {
        return wxUserDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        wxUserDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param wxUser 实体
     */
    public void saveOrUpdate(String userId, WxUser wxUser){
        wxUserDao.saveOrUpdate(userId,wxUser);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public WxUser getEntityByColumn(String key, String value) {
        return wxUserDao.getEntityByColumn(key, value);
    }
}
